package cn.kgc.springboot05.controller;

import cn.kgc.springboot05.entity.User;
import cn.kgc.springboot05.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author: mosin
 * @version: v1.0  2022/5/20
 */
@Controller
@RequestMapping("user")
public class UserController {
    @Autowired
    private UserService userService;

    @ResponseBody
    @RequestMapping("get")
    public Object getById(Integer id) {
       return userService.getById(id);
    }

    @ResponseBody
    @RequestMapping("update")
    public Object updateUser(User user) {
        return userService.updateUser(user);
    }
}
